<?php
session_start();
require_once 'header.php';
function __autoload($className)
	{
    	require_once('class/' . $className . '.class.php');
	}
session::need_manage();
$Userid=intval($_GET["userid"]);
$TicketID=intval($_GET["ticketid"]);
if(session::is_manager()==TRUE)
{
	$Close=database::Update('tickets',array(
	'userid' => $Userid,
	'ticketid' => $TicketID
	),array(
	'closed' => 1
	));
	$_SESSION["erro"]="The Ticket has been removed";
	redirect::location("viewtickets.php");
}
else 
{
	$_SESSION["erro"]="You do not have permission at here";
	redirect::location("deneid.php");
}

?>